{% extends "layout.html" %}
{% block body %}

	<ol class="breadcrumb">
		<li><a href="/">Home</a></li>
		<li><a href="/rebrow"><span class="logo"><span class="re">re</span>brow</span></a></li>
		<li class="active">login</li>
	</ol>

	<div class="row">

		<div class="col-md-6 col-md-offset-3">

			<h3><span class="logo">Connect to your <span class="sky">Sky</span><span class="re">line</span> Redis database</h3>

			<div class="well">

				<form role="form" action="/rebrow" method="POST" class="form-horizontal">

					<div class="form-group">
						<label for="host" class="col-sm-3">Host:</label>
						<div class="col-sm-9">
              <!-- # @modified 20190519 - Branch #3002: docker
							<input id="host" name="host" value="localhost" class="form-control" /> -->
							<input id="host" name="host" value="{{ host_input_value }}" class="form-control" />
							<p class="help-block">Set host to unix_socket if Skyline is running on docker</p>
						</div>
					</div>

					<div class="form-group">
						<label for="port" class="col-sm-3">Port:</label>
						<div class="col-sm-9">
							<input id="port" name="port" type="number" value="6379" class="form-control" size="6" style="width: 100px"/>
						</div>
					</div>

					<div class="form-group">
						<label for="db" class="col-sm-3">Database ID:</label>
						<div class="col-sm-9">
							<input id="db" name="db" type="number" value="0" class="form-control" size="3" style="width: 50px"/>
							<p class="help-block">If unsure, use 0 (zero).</p>
						</div>
					</div>

					<div class="form-group">
						<label for="password" class="col-sm-3">Password:</label>
						<div class="col-sm-9">
              <!-- # @modified 20190519 - Branch #3002: docker -->
  {% if display_redis_password == True %}
							<input type="password" id="password" name="password" value="{{ rebrow_redis_password }}" class="form-control" />
							<p class="help-block">The Redis password to connect to the unix socket is {{ rebrow_redis_password }}</p>
  {% else %}
							<input type="password" id="password" name="password" value="" class="form-control" />
  {% endif %}
						</div>
					</div>

<!-- # @added 20180529 - Feature #2378: Add redis auth to Skyline and rebrow -->
					<div class="form-group">
						<label for="db" class="col-sm-3">Token valid for:</label>
						<div class="col-sm-9">
							<input id="token_valid_for" name="token_valid_for" type="number" min="30" max="3600" value="3600" class="form-control" size="5" style="width: 100px"/>
							<p class="help-block">This is how many seconds you want your token for Redis authentication valid for, max allowed 3600.</p>
						</div>
					</div>

<!-- # @added 20180727 - Feature #2378: Add redis auth to Skyline and rebrow -->
  {% if protocol != 'https' %}
	  		<div class="alert alert-danger">
<strong>Warning!</strong> <b><span class="logo"><span class="sky">Skyline ::</span> <span class="re">is running misconfigured ::</span></span></b>
 You are not running Skyline behind a SSL terminated endpoint therefore POST
data submitted by this form will be sent encrypted, including your Redis
password or your proxy is not configured correctly and is not setting the
X-Forwarded-Proto header.
	  		</div>
  {% endif %}
  {% if proxied == False %}
	  		<div class="alert alert-danger">
<strong>Warning!</strong> <b><span class="logo"><span class="sky">Skyline ::</span> <span class="re">is running misconfigured ::</span></span></b>
 Skyline does not appear to be running behind a proxy or your proxy is not
configured correctly and it is not setting the X-Forwarded-Proto header.
	  		</div>
  {% endif %}
  {% if client_message != False %}
	  		<div class="alert alert-danger">
<strong>Warning!</strong> <b><span class="logo"><span class="sky">Skyline ::</span> <span class="re">message ::</span></span></b>
 {{ client_message }}
	  		</div>
  {% endif %}

					<div class="form-group">
						<div class="col-sm-9 col-sm-offset-3">
							<button type="submit" class="btn btn-default btn-primary">Connect</button>
						</div>
					</div>
				</form>
			</div>

		</div>
	</div>

{% endblock %}
